package com.example.Laboratory.Mapper;

import com.example.Laboratory.Entity.Leader;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface LeaderMapper {

    //添加学科带头人信息
    @Insert("INSERT INTO leader(leader_name,leader_duty,leader_major,leader_education,leader_degree,leader_direction,leader_thesis_achievement_name1,leader_thesis_grade_unit_time1,leader_number_sign1,leader_thesis_achievement_name2,leader_thesis_grade_unit_time2,leader_number_sign2,leader_thesis_achievement_name3,leader_thesis_grade_unit_time3,leader_number_sign3,leader_project_name1,leader_project_source1,leader_project_time1,leader_project_money1,leader_project_work1,leader_project_name2,leader_project_source2,leader_project_time2,leader_project_money2,leader_project_work2,leader_project_name3,leader_project_source3,leader_project_time3,leader_project_money3,leader_project_work3)" +
            "VALUES(#{leader_name},#{leader_duty},#{leader_major},#{leader_education},#{leader_degree},#{leader_direction},#{leader_thesis_achievement_name1},#{leader_thesis_grade_unit_time1},#{leader_number_sign1},#{leader_thesis_achievement_name2},#{leader_thesis_grade_unit_time2},#{leader_number_sign2},#{leader_thesis_achievement_name3},#{leader_thesis_grade_unit_time3},#{leader_number_sign3},#{leader_project_name1},#{leader_project_source1},#{leader_project_time1},#{leader_project_money1},#{leader_project_work1},#{leader_project_name2},#{leader_project_source2},#{leader_project_time2},#{leader_project_money2},#{leader_project_work2},#{leader_project_name3},#{leader_project_source3},#{leader_project_time3},#{leader_project_money3},#{leader_project_work3})")
    int addLeader (Leader l);

    //根据id删除学科带头人信息
    @Delete("DELETE FROM leader WHERE leader_id=#{leader_id}")
    int deleteLeader (int leader_id);

    //查找全表信息
    @Select("SELECT * FROM leader")
    List<Leader> researchLeader ( );

    //修改信息
    @Update("UPDATE leader SET leader_name=#{leader_name},leader_duty=#{leader_duty},leader_major=#{leader_major},leader_education=#{leader_education},leader_degree=#{leader_degree},leader_direction=#{leader_direction},leader_thesis_achievement_name1=#{leader_thesis_achievement_name1},leader_thesis_grade_unit_time1=#{leader_thesis_grade_unit_time1},leader_number_sign1=#{leader_number_sign1},leader_thesis_achievement_name2=#{leader_thesis_achievement_name2},leader_thesis_grade_unit_time2=#{leader_thesis_grade_unit_time2},leader_number_sign2=#{leader_number_sign2},leader_thesis_achievement_name3=#{leader_thesis_achievement_name3},leader_thesis_grade_unit_time3=#{leader_thesis_grade_unit_time3},leader_number_sign3=#{leader_number_sign3}," +
            "leader_project_name1=#{leader_project_name1},leader_project_source1=#{leader_project_source1},leader_project_time1=#{leader_project_time1},leader_project_money1=#{leader_project_money1},leader_project_work1=#{leader_project_work1},leader_project_name2=#{leader_project_name2},leader_project_source2=#{leader_project_source2},leader_project_time2=#{leader_project_time2},leader_project_money2=#{leader_project_money2},leader_project_work2=#{leader_project_work2},leader_project_name3=#{leader_project_name3},leader_project_source3=#{leader_project_source3},leader_project_time3=#{leader_project_time3},leader_project_money3=#{leader_project_money3},leader_project_work3=#{leader_project_work3} WHERE leader_id=#{leader_id}")
    int reviseLeader (Leader l);


}
